package form;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;

import trangchu.UtilDelegate;

public class DSJ_NPPMuaHang extends UtilDelegate {
	public String MaCC;
	public String NhaCungCap;
	public String DiaChi;
	public String DienThoai;
	public String Fax;
	public String Email;
	public String SoTaiKhoan;
	public String KhuVuc;
	public String getMaCC() {
		return MaCC;
	}
	public void setMaCC(String maCC) {
		MaCC = maCC;
	}
	public String getNhaCungCap() {
		return NhaCungCap;
	}
	public void setNhaCungCap(String nhaCungCap) {
		NhaCungCap = nhaCungCap;
	}
	public String getDiaChi() {
		return DiaChi;
	}
	public void setDiaChi(String diaChi) {
		DiaChi = diaChi;
	}
	public String getDienThoai() {
		return DienThoai;
	}
	public void setDienThoai(String dienThoai) {
		DienThoai = dienThoai;
	}
	public String getFax() {
		return Fax;
	}
	public void setFax(String fax) {
		Fax = fax;
	}
	public String getEmail() {
		return Email;
	}
	public void setEmail(String email) {
		Email = email;
	}
	public String getSoTaiKhoan() {
		return SoTaiKhoan;
	}
	public void setSoTaiKhoan(String soTaiKhoan) {
		SoTaiKhoan = soTaiKhoan;
	}
	public String getKhuVuc() {
		return KhuVuc;
	}
	public void setKhuVuc(String khuVuc) {
		KhuVuc = khuVuc;
	}
	public Vector<DSJ_NPPMuaHang> getUsers(){
		Vector list = new Vector();;
		Connection con =UtilDelegate.getConnection();		
		PreparedStatement st;
		try {
			st = con.prepareStatement("select * from NhaPhanPhoi join CacNganHang on NhaPhanPhoi.NganHang = CacNganHang.MaNH join CacKhuVuc on NhaPhanPhoi.KhuVuc = CacKhuVuc.MaKV ");
			ResultSet rs = st.executeQuery();
			while(rs.next()){
				Vector<String> b = new Vector<String>();
				b.add(rs.getString("MaCC"));
				b.add(rs.getString("NhaCungCap"));
				b.add(rs.getString("DiaChi"));
				b.add(rs.getString("DienThoai"));
				b.add(rs.getString("Fax"));
				b.add(rs.getString("Email"));
				b.add(rs.getString("SoTaiKhoan"));
				b.add(rs.getString("TenNH"));
				b.add(rs.getString("TenKV"));
				list.add(b);				
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		return list;
	}
}
